<template>
  <el-breadcrumb separator="/">
    <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
    <el-breadcrumb-item v-if="props.titleArr.length !== 0"
      ><a :href="toPath">{{ props.titleArr[0] }}</a></el-breadcrumb-item
    >
    <el-breadcrumb-item v-if="props.titleArr.length !== 0">{{
      props.titleArr[1]
    }}</el-breadcrumb-item>
  </el-breadcrumb>
</template>

<script lang="ts" setup>
import { reactive, toRefs, ref } from "vue";
const props = defineProps<{
  titleArr: string[]; // 用于面包屑显示文字的数组
  toPath: string; // 用于点击面包屑跳转到一级菜单
}>();
</script>
<style lang="less" scoped></style>
